#ifndef CPKMVPWIDGET_H
#define CPKMVPWIDGET_H

#include <QWidget>
#include <QLabel>
class CPKMvpWidget : public QWidget
{
    Q_OBJECT
public:
    explicit CPKMvpWidget(QWidget *parent = nullptr);

    //设置mvp头像框宽高
    void setIconSize(int width,int height);
    //设置mvp头像宽高
    void setHeadIconSize(int width,int height);

    void setHeadBorderIcon(QString url);

    void setHeadIcon(QString url);

Q_SIGNALS:
    void clicked();

protected:
    void mousePressEvent(QMouseEvent *ev) override;
    void mouseReleaseEvent(QMouseEvent *ev) override;

private:

    //刷新UI
    void updateUI(bool resize = false);

    QLabel *m_pLabelBorder;
    QLabel *m_pLabelHead;

    QSize m_mvpIconSize = QSize(38,25);
    QSize m_mvpHeadSize = QSize(18,18);

    QString m_mvpBorderUrl = "";
    QString m_mvpHeadIconUrl = "";

    bool m_bIsPressed = false;
};

#endif // CPKMVPWIDGET_H
